package wordcount;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class WordCountPartitioner extends Partitioner<Text, IntWritable> {
    @Override
    public int getPartition(Text key, IntWritable value, int i) {


        String num = key.toString().substring(0, 1);
        int res = Integer.valueOf(num);
        if(res % 2 == 0){
            return  0;
        }else {
            return  1;
        }
    }
}
